import request from '@/utils/request'

// 查询监管单位管理列表
export function listSupervisionUnit(query) {
  return request({
    url: '/nongjt/supervisionUnit/list',
    method: 'get',
    params: query
  })
}

// 查询监管单位管理详细
export function getSupervisionUnit(id) {
  return request({
    url: '/nongjt/supervisionUnit/' + id,
    method: 'get'
  })
}

// 新增监管单位管理
export function addSupervisionUnit(data) {
  return request({
    url: '/nongjt/supervisionUnit',
    method: 'post',
    data: data
  })
}

// 修改监管单位管理
export function updateSupervisionUnit(data) {
  return request({
    url: '/nongjt/supervisionUnit',
    method: 'put',
    data: data
  })
}

// 删除监管单位管理
export function delSupervisionUnit(ids) {
  return request({
    url: '/nongjt/supervisionUnit/' + ids,
    method: 'delete'
  })
}

// 根据省市区查询监管单位
export function getSupervisionUnitByRegion(province, city, district) {
  return request({
    url: '/nongjt/supervisionUnit/getByRegion',
    method: 'get',
    params: {
      province: province,
      city: city,
      district: district
    }
  })
}

// 检查省市区是否已存在监管单位
export function checkRegionExists(province, city, district) {
  return request({
    url: '/nongjt/supervisionUnit/checkRegion',
    method: 'get',
    params: {
      province: province,
      city: city,
      district: district
    }
  })
}

// 导出监管单位管理
export function exportSupervisionUnit(query) {
  return request({
    url: '/nongjt/supervisionUnit/export',
    method: 'post',
    params: query
  })
}
